package dao;


import org.apache.ibatis.annotations.*;
import pojo.po.Role;
import pojo.po.User;
import pojo.vo.AddUser;
import pojo.vo.PageBean;

import java.util.List;

public interface UserMapper {
    List<User> getUserList(@Param("pageBean") PageBean pageBean);

    List<User> getRole(@Param("id") String id);

    Integer getSum(@Param("pageBean")PageBean pageBean);

    void delete(String id);

    void constraintDelete(String id);

    @Select("select * from t_role")
    List<Role> getRoleList();

    void addUser(@Param("addUser") AddUser addUser);

    void addUser_Role(@Param("userid") Integer userid,@Param("roleid")Integer roleid);

    @Update("update t_user set username=#{username},password=#{password},email=#{email} where id =#{id}")
    void updata(AddUser addUser);

    @Update("update t_user_role set user_id= where id =#{id}")
    void updataUser_Role(@Param("id") Integer id, @Param("i") Integer i);

    @Delete("DELETE FROM t_user_role WHERE user_id = #{id}")
    void deleteUser_Role(AddUser addUser);
}
